home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LT_DisposeMenu.c < prev    next >
C/C++ Source or Header  |  1996-08-22  |  1KB  |  64 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #ifdef DO_MENUS
  15.  
  16. /****** gtlayout.library/LT_DisposeMenu ******************************************
  17. *
  18. *   NAME
  19. *    LT_DisposeMenu -- Release storage space allocated by
  20. *                      LT_NewMenuTemplate or LT_NewMenuTagList (V11)
  21. *
  22. *   SYNOPSIS
  23. *    LT_DisposeMenu(Menu)
  24. *                    A0
  25. *
  26. *    VOID LT_DisposeMenu(struct Menu *);
  27. *
  28. *   FUNCTION
  29. *    Menus and MenuItems allocated by LT_NewMenuTemplate or
  30. *    LT_NewMenuTagList are deallocated.
  31. *
  32. *   INPUTS
  33. *    Menu - Pointer to Menu structure as returned by
  34. *        LT_NewMenuTemplate or LT_NewMenuTagList. Passing
  35. *        NULL is harmless.
  36. *
  37. *   RESULT
  38. *    none
  39. *
  40. *   SEE ALSO
  41. *    gtlayout.library/LT_NewMenuTagList
  42. *    gtlayout.library/LT_NewMenuTemplate
  43. *
  44. ******************************************************************************
  45. *
  46. */
  47.  
  48. VOID LIBENT
  49. LT_DisposeMenu(REG(a0) struct Menu *Menu)
  50. {
  51.     if(Menu)
  52.     {
  53.         struct RootMenu *Root = (struct RootMenu *)((ULONG)Menu - offsetof(struct RootMenu,Menu));
  54.  
  55.         FreeScreenDrawInfo(Root->Screen,Root->DrawInfo);
  56.  
  57.         CloseFont(Root->Font);
  58.  
  59.         AsmDeletePool(Root->Pool,SysBase);
  60.     }
  61. }
  62.  
  63. #endif    /* DO_MENUS */
  64.